//
//  CounselingIformationCell.m
//  SanYiTeaching
//
//  Created by 李文强 on 2019/4/23.
//  Copyright © 2019 SanYi. All rights reserved.
//

#import "CounselingIformationCell.h"
#import "SYTopLabView.h"

@interface CounselingIformationCell ()

@property (strong, nonatomic) SYTopLabView *topLabView;

@end


@implementation CounselingIformationCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if ([super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self initSubView];
        [self layout];
    }
    return self;
}
- (void)initSubView{
//    [self addSubview:self.baseView];
//    _baseView.frame = CGRectMake(100, 0, self.frame.size.width-200, 40);
//    CGFloat X = (self.frame.size.width - 200)/7;
//    for (int i = 0; i<7; i++) {
//        UILabel *label = [[UILabel alloc]init];
//        label.text = @"测试";
//        label.textAlignment = 1;
//        label.font = [UIFont systemFontOfSize:13];
//        label.textColor = TITLECOLOR;
//        label.tag = 1+i;
//        [_baseView addSubview:label];
//        label.frame = CGRectMake(X*i, 10, X, 20);
//    }
}
- (void)reloadViewLayout{
//    CGFloat X = (self.frame.size.width - 200)/7;
//    CGFloat W = X-12;
//        for (int i = 0; i<7; i++) {
//            UILabel *label = (UILabel *)[_baseView viewWithTag:i+1];
//            if (i == 0) {
//                label.frame = CGRectMake(0, 10, X/1.8, 20);
//            }else if(i == 1){
//                label.frame = CGRectMake(X/1.8, 10, 1.5*X, 20);
//            }else if (i == 2){
//                label.frame = CGRectMake(X/1.8+X*1.5, 10, 2*X, 20);
//            }else{
//                label.frame = CGRectMake(X/1.8+X*3.5+W*(i-3), 10, W, 20);
//            }
//            label.text = self.nameArray[i];
//        }
    
    [_topLabView removeFromSuperview];
    _topLabView = [[SYTopLabView alloc] initWithDataNameArr:self.nameArray width:0.125];
    [self addSubview:_topLabView];
    _topLabView.jinXingView.backgroundColor = [UIColor whiteColor];
    _topLabView.backgroundColor = [UIColor whiteColor];
    [self.topLabView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.mas_top);
        make.left.equalTo(self.mas_left).offset(90);
        make.height.mas_equalTo(40);
        make.right.equalTo(self.mas_right).offset(-90);
    }];
}
- (void)layout{
   
}
- (UIView *)baseView{
    if (!_baseView) {
        UIView *view = [[UIView alloc]init];
        view.backgroundColor = [UIColor whiteColor];
        _baseView = view;
    }
    return _baseView;
}

- (SYTopLabView *)topLabView {
    if (!_topLabView) {
        
    }
    return _topLabView;
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
